package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.Area;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @packageName: com.ruoyi.system.mapper
 * @user: andyliu
 * @date: 2023/2/18 14:37
 * @email 115176513@qq.com
 * @description: TODO
 */

public interface AreaMapper {
    @Insert("insert into a_area(area_name) values(#{name})")
    int insertArea(Area area);
    @Update("update a_area set area_name=#{name} where area_id=#{id}")
    int updateArea(Area area);
    @Delete("delete from a_area where area_id=#{id}")
    int deleteById(Integer id);
    @Select("select area_id as id,area_name as name from a_area  where area_id=#{id}")
    Area selectById(Integer id);
    @Select("select area_id as id,area_name as name from a_area  where area_name like '%${name}%'")
    // %a%  1111aaa3222
    // _a 1a 1a
    List<Area> select(Area area);
}
